<?php $title = 'title_'.$this->lang; ?>
<div id="left-600">
	<div class="box-h1">
		<h1 title="New Books"><?=Kohana::lang('title.newbooks')?></h1>
		<div class="box1">
			<ul class="book-list s600">
			<?php $i=1; foreach($new_products as $product) { ?>
			<li>
				<?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, html::image(($product->photo_ext != '') ? 'photo/product/120/120/'.$product->id.'.'.$product->photo_ext : 'photo/product/120/120/nocover.jpg'))?>
				<h3><?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, $product->$title)?></h3>
				<h4>$<?=$product->price?></h4>
			</li>
				<?php if( $i != count($new_products) && $i % 3 == 0 ) { ?>
					</ul><hr/><ul class="book-list s600">
				<?php } ?>
			<?php $i++; } ?>
			</ul>
			<p style="clear:both"></p>
		</div>
	</div>
	<div class="box-h1" style="padding-top:20px;">
		<h1 title="Best Sellers"><?=Kohana::lang('title.bestsellers')?></h1>
		<div class="box1">
			<ul class="book-list s600">
			<?php $i=1; foreach($best_products as $product) { ?>
			<li>
				<?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, html::image(($product->photo_ext != '') ? 'photo/product/120/120/'.$product->id.'.'.$product->photo_ext : 'photo/product/120/120/nocover.jpg'))?>
				<h3><?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, $product->$title)?></h3>
				<h4>$<?=$product->price?></h4>
			</li>
				<?php if( $i != count($best_products) && $i % 3 == 0 ) { ?>
					</ul><hr/><ul class="book-list s600">
				<?php } ?>
			<?php $i++; } ?>
			</ul><p style="clear:both"></p>
		</div>
	</div>
</div>
<div id="right-180">
	<div class="box-h1" id="home-newbooks">
		<h1 title="On Sale"><?=Kohana::lang('title.onsale')?></h1>
		<div class="box">
			<ul class="bh-book-list">	
			<?php foreach($onsale as $product) { ?>
				<li>
					<?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, html::image(($product->photo_ext != '') ? 'photo/product/120/120/'.$product->id.'.'.$product->photo_ext : 'photo/product/120/120/nocover.jpg'))?><br/>
					<p><?=html::anchor('bookstore/product/'.$product->category_id.'/'.$product->id, $product->$title)?>
					<br/><strike>$<?=$product->market_price?></strike>&#160;&#160; $<?=$product->price?></p>
				</li>
			<?php } ?>
			</ul>
			<div style="clear:both;"></div>
		</div>
	</div>
	<?php include(Kohana::find_file('views', 'common/forum')); ?>
</div>
